import { STORAGE_KEY } from './mutations'

// console.log(process.env.NODE_ENV)

const localStoragePlugin = store => {
	store.subscribe( (mutation, { todos }) => {
		window.localStorage.setItem(STORAGE_KEY, JSON.stringify(todos))
	})
}

export default [localStoragePlugin];